package day10;
import java.util.Scanner;
public class learn9 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        boolean count=false;
        boolean count1=false;
        System.out.println("**********欢迎进入作业提交的系统**********");
        System.out.println("请输入java文件名:");
        String th=sc.next();
        System.out.println("请输入邮箱的格式:");
        String th1=sc.next();
      int index=th.lastIndexOf(".");
      if(index!=-1&&index!=0&&th.substring(index+1,th.length()).equals("java")){
          count=true;
      }else{
          System.out.println("文件名无效");
      }
if(th1.indexOf('@')!=-1&&th1.indexOf('.')>th1.indexOf('@')){
    count1=true;

        }else{
    System.out.println("邮件无效");
        }if(count&&count1){
    System.out.println("作业提交成功");
        }else{
    System.out.println("作业提交失败");
        }
    }
}
